package com.headingdata.d6_interface2;


public class Test {

    public static void main(String[] args) {
        //目标：搞清楚使用接口的好处
        Driver d = new A();
        d.drive();

        A a = new A();
        a.drive();
        a.singe();

        Singer s = new A();
        s.singe();

    }
}
interface  Driver{

    void  drive();
}
interface  Singer{

    void singe();
}

class Student {
    private String name;
    private int age;

    public  Student(){

    }
    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }



}
class A extends Student implements Driver,Singer{

    public A(){

    }

    public A(String name, int age) {
        super(name, age);
    }

    @Override
    public void drive() {

    }

    @Override
    public void singe() {

    }
}
